import { getChannelsAPI } from "../../api/channel";
import { ChannelSaveList, ChannelSetId } from "./actionTypes";

export const getChannelsAction = () => {
  return async (dispatch) => {
    const res = await getChannelsAPI();
    dispatch({ type: ChannelSaveList, payload: res.data.channels });
  };
};

export const setIdAction = (payload) => ({
  type: ChannelSetId,
  payload,
});
